<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>自定义的图片图标</title>
    <style>
        body{
            background-color: #000;
        }
        .icon{
            width: 21px;
            height: 17px;
            background-image: url(img/spr_common.png);
            background-repeat: no-repeat;
            display: inline-block;
            border: 1px solid #000;
            cursor: pointer;
        }
        .icon-wb{
            background-position: -195px -141px;
        }
        .icon-wb:hover{
            background-position: -221px -141px;
        }
        .icon-wx{
            background-position: -225px -197px;
        }
        .icon-wx:hover{
            background-position: -225px -176px;
        }
        .icon-wx+.wx-code{
            /* display: none; */
            transition: opacity 0.5s,top .5s;
            opacity: 0;
            position: relative;
            top: -10px;
        }
        .icon-wx:hover+.wx-code{
            /* display: block; */
            opacity: 1;
            top: 0px;
        }
    </style>
</head>
<body>
    <i class="icon icon-wb"></i>
    <i class="icon icon-wx"></i>
    <div class="wx-code">
        <img src="img/code.png" alt="">
    </div>
</body>
</html>